package com.mapper;

import com.beans.Question;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.beans.Article;

import java.util.List;

@Mapper
@Repository//Dao层
public interface ArticleMapper extends BaseMapper<Article> {
	// 这里不需要手写基本的 CRUD(增删改查) 方法，已经自动生成,但也可以写，如果需要复杂的查询等操作还是要自己手写
    List<Article> getAllArticles();

    Article getArticleById(@Param("ArticleID") Long ArticleID);

    List<Article> getArticlesByGradeId(@Param("gradeId") Long gradeId);
    List<Article> selectArticlesByGrade(String grade);

    List<Article> searchArticles(String keyword);

    int searchAllByTitle(@Param("title") String title);
    //根据id查询
    Article searchByArticleID(@Param("articleID") Integer articleID);
//更新文章
    int updateSelective(Article article);
//根据文章id删除
    int delByArticleID(@Param("articleID") Integer articleID);

    int insertSelective(Article article);

























































}
